def count(str):
    int_count = 0
    word = 0
    space = 0
    other = 0
    for i in str:
        if i.isdigit():
            int_count += 1
        elif i.isalpha():
            word += 1
        elif i == ' ':
            space += 1
        else:
            other += 1
    return int_count, word, space, other


if not count(''):
    print('测试成功')
if count('12abAB [$') == (2, 4, 1, 2):
    print('测试成功')
else:
    print('测试失败')
